﻿using System.Diagnostics;

namespace SvnDeploy.Service.Impl
{
    internal class EventLogImpl : ILog
    {
        private const string EVENT_SOURCE = SvnDeploymentService.SERVICE_NAME;

        public void Write(string message, EventLogEntryType eventLogEntryType)
        {
            if (!EventLog.SourceExists(EVENT_SOURCE))
            {
                EventLog.CreateEventSource(EVENT_SOURCE, EVENT_SOURCE);
            }
            EventLog MyEventLog = new EventLog();
            MyEventLog.Source = EVENT_SOURCE;
            MyEventLog.WriteEntry(message, eventLogEntryType);
        }
    }
}
